<?php

function CErr($x) {
	return CIsA($x, 'CError') ? $x : false;
}

function CErrorShowSimplePage($err) {
	header('HTTP/1.1 500 Internal Server Error');
?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>An error occurred: <?= (integer) $err->Code ?></title>
	</head>

	<body>
		<h1>An error occurred.</h1>
		<p><pre><?= htmlspecialchars($err->Description()) ?></pre></p>
	</body>
	</html>
<?php
}

?>